package android.app.gfestival;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import android.app.Activity;
import android.app.gfestival.component.ProgramViewSwicher;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;

public class ProgramActivity extends Activity{
	private static final String TAG = "ProgramActivity";
	private ProgramViewSwicher view;
	private List<String> data;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
//		data = new ArrayList<String>();
//		for(int i=0; i < 3; i++){
////			DateFormat fomat = new SimpleDateFormat(pattern);
//			Date date = new Date(System.currentTimeMillis());
//			String today = DateFormat.getDateInstance(DateFormat.YEAR_FIELD).format(date);
//			SimpleDateFormat format = new SimpleDateFormat("EEEE dd - MMM yyyy");
//			
//			data.add(format.format(date).replace("-", "of"));
//		}
		view = new ProgramViewSwicher(this);
		setContentView(view);
	}
	
	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if(keyCode != KeyEvent.KEYCODE_BACK) return super.onKeyDown(keyCode, event);
		if(view.showPreviou() < 0 ){
			getParent().finish();
		}
		return false;
	}
}
